package com.example.springbootfirst.api;

import com.example.springbootfirst.entity.UserEntity;
import com.example.springbootfirst.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * created by Morgan on 2021/10/2
 */
@RestController
@Api(tags = "admin controller")
@RequestMapping("/api/v1/admin")
public class AdminController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    @ApiOperation("登录接口")
    public String login(@RequestBody UserEntity entity) {
        return userService.login(entity);
    }
}
